package net.sx.minemodule.mvp.item;

import android.view.View;

import com.alibaba.android.arouter.launcher.ARouter;
import com.homegoods.aroutercomment.ARouterPath;
import com.kedll.library.mvp.BaseItem;

import net.sx.minemodule.R;
import net.sx.minemodule.mvp.bean.GoodsBean;
import net.sx.minemodule.mvp.bean.OrderBean;

import java.util.List;

/**
 * 描述:  订单单个商品
 * author:胡邦茂
 * CreateDate: 2019/7/7 11:37
 */
public class OrderItem extends BaseItem<OrderBean> {

    public OrderItem(OrderBean data) {
        super(data);
    }

    @Override
    public int getLayout() {
        return R.layout.mine_view_order;
    }

    public String getOrderType() {
        return getData().getOrderType();
    }

    public List<GoodsBean> getGoodsBeanList() {
        return getData().getOrderProducts();
    }

    public int getGoodsCount() {
        return getData().getGoodsCount();
    }

    public String getGoodsAllMoney() {
        return String.valueOf(getData().getTotalAmount());
    }

    public void orderClick(View view) {
        ARouter.getInstance().build(ARouterPath.PATH_MINE_ORDER_DETAIL).withString("orderId", String.valueOf(getData().getOrderId())).navigation();
    }

}
